{% load i18n %}
{% load lfs_tags %}

<div class="navigation-pages-inline">
    {% if page_2.has_previous %}
        <a class="ajax-link"
           href="{% url lfs_manage_category_products_inline category.id %}?page_2=1&amp;keep-session=1"><img src="{{ STATIC_URL }}icons/resultset_first.png" alt='{% trans "First" %}' /></a>
        <a class="ajax-link"
           href="{% url lfs_manage_category_products_inline category.id %}?page_2={{ page_2.previous_page_number }}&amp;keep-session=1"><img src="{{ STATIC_URL }}icons/resultset_previous.png" alt='{% trans "Previous" %}' /></a>
    {% else %}
        <span><img src="{{ STATIC_URL }}icons/resultset_first.png" alt='{% trans "First" %}' /></span>
        <span><img src="{{ STATIC_URL }}icons/resultset_previous.png" alt='{% trans "Previous" %}' /></span>
    {% endif %}

    <span style="position: relative; top:-4px ">
        {{ page_2.number }} {% trans "of" %} {{ paginator_2.num_pages }}
    </span>

    {% if page_2.has_next %}
        <a class="ajax-link"
           href="{% url lfs_manage_category_products_inline category.id %}?page_2={{ page_2.next_page_number }}&amp;keep-session=1"><img src="{{ STATIC_URL }}icons/resultset_next.png" alt='{% trans "Next" %}' /></a>
        <a class="ajax-link"
           href="{% url lfs_manage_category_products_inline category.id%}?page_2={{ paginator_2.num_pages }}&amp;keep-session=1"><img src="{{ STATIC_URL }}icons/resultset_last.png"  alt='{% trans "Last" %}' /></a>

    {% else %}
        <span><img src="{{ STATIC_URL }}icons/resultset_next.png" alt='{% trans "Next" %}' /></span>
        <span><img src="{{ STATIC_URL }}icons/resultset_last.png"  alt='{% trans "Last" %}' /></span>
    {% endif %}
</div>
<form id="category-products-remove-form"
      action="{% url lfs_manage_category_remove_products category.id %}"
      method="post">
    <div id="category-products-right">
        <table class="lfs-manage-table">
            <tr>
                <th class="checkbox">
                    <input type="checkbox"
                           class="select-all"
                           value="selected-products" />
                </th>
                <th>
                    {% trans 'Name' %}
                </th>
                <th class="middle">
                    {% trans 'SKU' %}
                </th>
                <th class="tiny right-padding">
                    {% trans 'Active' %}
                </th>
            </tr>
            {% for product in page_2.object_list %}
                <tr class="{% cycle 'even' 'odd' %}">
                    <td>
                        <input type="checkbox" class="select-selected-products" name="{{ product.id }}" />
                    </td>
                    <td>
                        <a href="{% url lfs_manage_product product.id %}">
                            {{ product.get_name }}
                        </a>
                    </td>
                    <td>
                        {{ product.get_sku }}
                    </td>
                    <td class="right-padding">
                        {% if product.is_active %}
                            <img src="{{ STATIC_URL }}icons/tick.png" />
                        {% else %}
                            <img src="{{ STATIC_URL }}icons/cross.png" />
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
        </table>
    </div>
    <input type="hidden"
           name="keep-session"
           value="1" />

    <div class="buttons">
        <input type="submit"
               class="ajax-save-button button"
               value="{% trans 'Remove from category' %}" />
    </div>
</form>
<script>
    align_buttons("#category-products");
</script>
